<?php
/**
 *  NevuxBB - Free Forum Software
 *  Copyright (C) 2008, 2010 NevuxBB (No one specific author)*  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Footer File
 * File: footer.php
 * Purpose: The ending of the forum pages
 * Todo: Finish writing it
 *
 */

// finish calculating the execution time
$pps_mtime = microtime();
$pps_mtime = explode(' ', $pps_mtime);
$pps_mtime = $pps_mtime[1] + $pps_mtime[0];
$pps_end = $pps_mtime;
$pps_totaltime = round(($pps_end - $pps_start), 3);

// build the language and variables
$core_template_system->setvar(array('copyright' => sprintf($core_lang_system->get_var('COPYRIGHT', 2), 'http://www.nevuxbb.com/', date('Y')),
									'acp_link' => $core_lang_system->get_var('ACP_LINK', 2)));

// should we lay the debugging out?
if(GlobalSettings::getSetting('debug_enabled') == 1) {
	$core_template_system->setvar('debug', sprintf($core_lang_system->get_var('DEBUG', 2), $pps_totaltime, 
																			  			   Db_Abstraction::get_total_queries(),
																						   convert_size(memory_get_usage(true))));
}

// build the footer
$core_template_system->newTemplate(BASE_PATH . '/templates/' . ForumSettings::getCurrentTemplate() . '/footer.html');
$core_template_system->pparse();

// temp debug info for sql queries
#echo('<!--');
#foreach( Db_Abstraction::get_total_queries_array() as $key => $value ){echo "<br />$key - $value";}	
#echo('-->');

// finished
exit();
?>